﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace laohan.Common.APIInter
{
    /// <summary>
    /// json序列化接口
    /// </summary>
    public interface IJson
    {
        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="t"></param>
        /// <returns></returns>
        string Serialize<T>(T t);

        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        string Serialize(object t);

        /// <summary>
        /// 字符串反序列化称json
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="json"></param>
        /// <returns></returns>
        T Deserialize<T>(string json);
    }
}
